#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<cmath>
#include<string.h>
using namespace std; 

int main()
{   
  int n,a[10010];
  while(cin>>n){
    if(n==0)  break;
    for(int i=0;i<n;i++)
      cin>>a[i];
    sort(a,a+n);
    if(n%2==0)  cout<<( a[n/2]+a[n/2-1] )/2<<endl;
    else cout<<a[n/2]<<endl;
  }
  
  //system("pause");  
  return 0;
}
